/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ile.VISTA;

import ile.DAO.HerramientaDAO;
import ile.DAO.MaterialDAO;
import ile.DAO.PedidoDAO;
import ile.DAO.PedidoMaterialDAO;
import ile.Modelo.Herramienta;
import ile.Modelo.Marca;
import ile.Modelo.Marka;
import ile.Modelo.Materiales;
import ile.Modelo.Pedido;
import ile.Modelo.PedidoMaterial;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author 
 */
public class TecladoVirtual extends javax.swing.JDialog {
    JTextField entrada;
    JTable tablaDatos;
    String cadena;


    /**
     * Creates new form TecladoVirtual
     */
    public TecladoVirtual(java.awt.Frame parent, boolean modal, 
            JTextField texto, JTable tabla, String i) {
        super(parent, modal);
        entrada= texto;
        tablaDatos=tabla;
        cadena=i;
        initComponents();
        setLocation(100, 300);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel5 = new javax.swing.JPanel();
        boton1 = new javax.swing.JButton();
        boton2 = new javax.swing.JButton();
        boton3 = new javax.swing.JButton();
        boton4 = new javax.swing.JButton();
        boton5 = new javax.swing.JButton();
        boton6 = new javax.swing.JButton();
        boton7 = new javax.swing.JButton();
        boton8 = new javax.swing.JButton();
        boton9 = new javax.swing.JButton();
        boton0 = new javax.swing.JButton();
        botonQ = new javax.swing.JButton();
        botonW = new javax.swing.JButton();
        botonE = new javax.swing.JButton();
        botonR = new javax.swing.JButton();
        botonT = new javax.swing.JButton();
        botonY = new javax.swing.JButton();
        botonU = new javax.swing.JButton();
        botonI = new javax.swing.JButton();
        botonOO = new javax.swing.JButton();
        botonP = new javax.swing.JButton();
        botonbORRAR = new javax.swing.JButton();
        botonINTRO = new javax.swing.JButton();
        botonENIE = new javax.swing.JButton();
        botonL = new javax.swing.JButton();
        botonK = new javax.swing.JButton();
        botonJ = new javax.swing.JButton();
        botonH = new javax.swing.JButton();
        botonG = new javax.swing.JButton();
        botonF = new javax.swing.JButton();
        botonD = new javax.swing.JButton();
        botonS = new javax.swing.JButton();
        botonA = new javax.swing.JButton();
        botonZ = new javax.swing.JButton();
        botonX = new javax.swing.JButton();
        botonC = new javax.swing.JButton();
        botonV = new javax.swing.JButton();
        botonB = new javax.swing.JButton();
        botonN = new javax.swing.JButton();
        botonM = new javax.swing.JButton();
        botoncOMILLAS = new javax.swing.JButton();
        botondOLAR = new javax.swing.JButton();
        botonNUMERAL = new javax.swing.JButton();
        botonEspacio = new javax.swing.JButton();
        btnSalir = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jPanel5.setBackground(new java.awt.Color(126, 166, 189));
        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Teclado Virtual", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("DejaVu Sans", 1, 14))); // NOI18N

        boton1.setBackground(new java.awt.Color(154, 184, 219));
        boton1.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        boton1.setText("1");
        boton1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        boton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                boton1ActionPerformed(evt);
            }
        });

        boton2.setBackground(new java.awt.Color(154, 184, 219));
        boton2.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        boton2.setText("2");
        boton2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        boton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                boton2ActionPerformed(evt);
            }
        });

        boton3.setBackground(new java.awt.Color(154, 184, 219));
        boton3.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        boton3.setText("3");
        boton3.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        boton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                boton3ActionPerformed(evt);
            }
        });

        boton4.setBackground(new java.awt.Color(154, 184, 219));
        boton4.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        boton4.setText("4");
        boton4.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        boton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                boton4ActionPerformed(evt);
            }
        });

        boton5.setBackground(new java.awt.Color(154, 184, 219));
        boton5.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        boton5.setText("5");
        boton5.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        boton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                boton5ActionPerformed(evt);
            }
        });

        boton6.setBackground(new java.awt.Color(154, 184, 219));
        boton6.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        boton6.setText("6");
        boton6.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        boton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                boton6ActionPerformed(evt);
            }
        });

        boton7.setBackground(new java.awt.Color(154, 184, 219));
        boton7.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        boton7.setText("7");
        boton7.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        boton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                boton7ActionPerformed(evt);
            }
        });

        boton8.setBackground(new java.awt.Color(154, 184, 219));
        boton8.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        boton8.setText("8");
        boton8.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        boton8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                boton8ActionPerformed(evt);
            }
        });

        boton9.setBackground(new java.awt.Color(154, 184, 219));
        boton9.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        boton9.setText("9");
        boton9.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        boton9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                boton9ActionPerformed(evt);
            }
        });

        boton0.setBackground(new java.awt.Color(154, 184, 219));
        boton0.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        boton0.setText("0");
        boton0.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        boton0.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                boton0ActionPerformed(evt);
            }
        });

        botonQ.setBackground(new java.awt.Color(154, 184, 219));
        botonQ.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonQ.setText("Q");
        botonQ.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonQ.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonQActionPerformed(evt);
            }
        });

        botonW.setBackground(new java.awt.Color(154, 184, 219));
        botonW.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonW.setText("W");
        botonW.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonW.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonWActionPerformed(evt);
            }
        });

        botonE.setBackground(new java.awt.Color(154, 184, 219));
        botonE.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonE.setText("E");
        botonE.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonE.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonEActionPerformed(evt);
            }
        });

        botonR.setBackground(new java.awt.Color(154, 184, 219));
        botonR.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonR.setText("R");
        botonR.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonR.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonRActionPerformed(evt);
            }
        });

        botonT.setBackground(new java.awt.Color(154, 184, 219));
        botonT.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonT.setText("T");
        botonT.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonT.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonTActionPerformed(evt);
            }
        });

        botonY.setBackground(new java.awt.Color(154, 184, 219));
        botonY.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonY.setText("Y");
        botonY.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonY.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonYActionPerformed(evt);
            }
        });

        botonU.setBackground(new java.awt.Color(154, 184, 219));
        botonU.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonU.setText("U");
        botonU.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonU.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonUActionPerformed(evt);
            }
        });

        botonI.setBackground(new java.awt.Color(154, 184, 219));
        botonI.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonI.setText("I");
        botonI.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonI.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonIActionPerformed(evt);
            }
        });

        botonOO.setBackground(new java.awt.Color(154, 184, 219));
        botonOO.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonOO.setText("O");
        botonOO.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonOO.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonOOActionPerformed(evt);
            }
        });

        botonP.setBackground(new java.awt.Color(154, 184, 219));
        botonP.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonP.setText("P");
        botonP.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonP.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonPActionPerformed(evt);
            }
        });

        botonbORRAR.setBackground(new java.awt.Color(154, 184, 219));
        botonbORRAR.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonbORRAR.setText("CLEAR");
        botonbORRAR.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonbORRAR.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonbORRARActionPerformed(evt);
            }
        });

        botonINTRO.setBackground(new java.awt.Color(154, 184, 219));
        botonINTRO.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonINTRO.setText("INTRO");
        botonINTRO.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonINTRO.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonINTROActionPerformed(evt);
            }
        });

        botonENIE.setBackground(new java.awt.Color(154, 184, 219));
        botonENIE.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonENIE.setText("Ñ");
        botonENIE.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonENIE.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonENIEActionPerformed(evt);
            }
        });

        botonL.setBackground(new java.awt.Color(154, 184, 219));
        botonL.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonL.setText("l");
        botonL.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonL.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonLActionPerformed(evt);
            }
        });

        botonK.setBackground(new java.awt.Color(154, 184, 219));
        botonK.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonK.setText("K");
        botonK.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonK.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonKActionPerformed(evt);
            }
        });

        botonJ.setBackground(new java.awt.Color(154, 184, 219));
        botonJ.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonJ.setText("J");
        botonJ.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonJ.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonJActionPerformed(evt);
            }
        });

        botonH.setBackground(new java.awt.Color(154, 184, 219));
        botonH.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonH.setText("H");
        botonH.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonH.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonHActionPerformed(evt);
            }
        });

        botonG.setBackground(new java.awt.Color(154, 184, 219));
        botonG.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonG.setText("G");
        botonG.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonG.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonGActionPerformed(evt);
            }
        });

        botonF.setBackground(new java.awt.Color(154, 184, 219));
        botonF.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonF.setText("F");
        botonF.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonF.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonFActionPerformed(evt);
            }
        });

        botonD.setBackground(new java.awt.Color(154, 184, 219));
        botonD.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonD.setText("D");
        botonD.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonD.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonDActionPerformed(evt);
            }
        });

        botonS.setBackground(new java.awt.Color(154, 184, 219));
        botonS.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonS.setText("S");
        botonS.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonS.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonSActionPerformed(evt);
            }
        });

        botonA.setBackground(new java.awt.Color(154, 184, 219));
        botonA.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonA.setText("A");
        botonA.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonA.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonAActionPerformed(evt);
            }
        });

        botonZ.setBackground(new java.awt.Color(154, 184, 219));
        botonZ.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonZ.setText("Z");
        botonZ.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonZ.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonZActionPerformed(evt);
            }
        });

        botonX.setBackground(new java.awt.Color(154, 184, 219));
        botonX.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonX.setText("X");
        botonX.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonX.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonXActionPerformed(evt);
            }
        });

        botonC.setBackground(new java.awt.Color(154, 184, 219));
        botonC.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonC.setText("C");
        botonC.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonC.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonCActionPerformed(evt);
            }
        });

        botonV.setBackground(new java.awt.Color(154, 184, 219));
        botonV.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonV.setText("V");
        botonV.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonV.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonVActionPerformed(evt);
            }
        });

        botonB.setBackground(new java.awt.Color(154, 184, 219));
        botonB.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonB.setText("B");
        botonB.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonBActionPerformed(evt);
            }
        });

        botonN.setBackground(new java.awt.Color(154, 184, 219));
        botonN.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonN.setText("N");
        botonN.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonN.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonNActionPerformed(evt);
            }
        });

        botonM.setBackground(new java.awt.Color(154, 184, 219));
        botonM.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonM.setText("M");
        botonM.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonM.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonMActionPerformed(evt);
            }
        });

        botoncOMILLAS.setBackground(new java.awt.Color(154, 184, 219));
        botoncOMILLAS.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botoncOMILLAS.setText("\"");
        botoncOMILLAS.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botoncOMILLAS.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botoncOMILLASActionPerformed(evt);
            }
        });

        botondOLAR.setBackground(new java.awt.Color(154, 184, 219));
        botondOLAR.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botondOLAR.setText("$");
        botondOLAR.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botondOLAR.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botondOLARActionPerformed(evt);
            }
        });

        botonNUMERAL.setBackground(new java.awt.Color(154, 184, 219));
        botonNUMERAL.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonNUMERAL.setText("#");
        botonNUMERAL.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botonNUMERAL.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonNUMERALActionPerformed(evt);
            }
        });

        botonEspacio.setBackground(new java.awt.Color(154, 184, 219));
        botonEspacio.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        botonEspacio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonEspacioActionPerformed(evt);
            }
        });

        btnSalir.setBackground(new java.awt.Color(154, 184, 219));
        btnSalir.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
        btnSalir.setText("Salir");
        btnSalir.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        btnSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSalirActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addContainerGap(851, Short.MAX_VALUE)
                .addComponent(btnSalir, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel5Layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel5Layout.createSequentialGroup()
                            .addComponent(botonQ, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(botonW, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(botonE, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(botonR, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(botonT, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(botonY, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(botonU, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(botonI, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(botonOO, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(botonP, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(botonbORRAR, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGroup(jPanel5Layout.createSequentialGroup()
                            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jPanel5Layout.createSequentialGroup()
                                    .addGap(26, 26, 26)
                                    .addComponent(botonA, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(botonS, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(botonD, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(botonF, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(botonG, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(botonH, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(botonJ, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(botonK, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(botonL, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(botonENIE, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(botonINTRO, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel5Layout.createSequentialGroup()
                                    .addGap(54, 54, 54)
                                    .addComponent(boton1, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boton2, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boton3, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boton4, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boton5, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boton6, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boton7, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boton8, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boton9, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boton0, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel5Layout.createSequentialGroup()
                                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel5Layout.createSequentialGroup()
                                            .addGap(72, 72, 72)
                                            .addComponent(botonZ, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(botonX, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(botonC, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(botonV, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(botonB, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(botonN, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(botonM, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(botoncOMILLAS, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(botondOLAR, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(jPanel5Layout.createSequentialGroup()
                                            .addGap(202, 202, 202)
                                            .addComponent(botonEspacio, javax.swing.GroupLayout.PREFERRED_SIZE, 507, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(botonNUMERAL, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGap(0, 1, Short.MAX_VALUE)))
                    .addContainerGap()))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(btnSalir, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(332, Short.MAX_VALUE))
            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(boton1, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(boton2, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(boton3, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(boton4, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(boton5, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(boton6, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(boton7, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(boton8, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(boton9, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(boton0, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(botonQ, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botonW, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botonE, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botonR, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botonT, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botonY, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botonU, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botonI, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botonOO, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botonP, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botonbORRAR, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(botonA, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botonS, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botonD, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botonF, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botonG, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botonH, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botonJ, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botonK, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botonL, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botonENIE, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botonINTRO, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(botonZ, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botonX, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botonC, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botonV, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botonB, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botonN, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botonM, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botoncOMILLAS, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botondOLAR, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(botonNUMERAL, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addComponent(botonEspacio, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap()))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void boton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_boton1ActionPerformed
        // TODO add your handling code here:
        boton1.addActionListener(null);
        entrada.setText(entrada.getText()+ "1");
        tipoDatos();
       
    }//GEN-LAST:event_boton1ActionPerformed

    private void boton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_boton2ActionPerformed
        boton2.addActionListener(null);
        entrada.setText(entrada.getText() + "2");
        tipoDatos();
        // txtLetras.setText(texto.getText());
    }//GEN-LAST:event_boton2ActionPerformed

    private void boton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_boton3ActionPerformed
        // TODO add your handling code here:
        boton3.addActionListener(null);
        entrada.setText(entrada.getText() + "3");
        tipoDatos();
       
    }//GEN-LAST:event_boton3ActionPerformed

    private void boton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_boton4ActionPerformed
        // TODO add your handling code here:
        boton4.addActionListener(null);
        entrada.setText(entrada.getText() + "4");
        tipoDatos();
        
    }//GEN-LAST:event_boton4ActionPerformed

    private void boton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_boton5ActionPerformed
        // TODO add your handling code here:
        boton5.addActionListener(null);
        entrada.setText(entrada.getText() + "5");
        tipoDatos();
        
    }//GEN-LAST:event_boton5ActionPerformed

    private void boton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_boton6ActionPerformed
        // TODO add your handling code here:
        boton6.addActionListener(null);
        entrada.setText(entrada.getText() + "6");
        /// txtLetras.setText(texto.getText());
    }//GEN-LAST:event_boton6ActionPerformed

    private void boton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_boton7ActionPerformed
        // TODO add your handling code here:

        boton7.addActionListener(null);
        entrada.setText(entrada.getText() + "7");
        tipoDatos();
        //  txtLetras.setText(texto.getText());
    }//GEN-LAST:event_boton7ActionPerformed

    private void boton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_boton8ActionPerformed
        // TODO add your handling code here:
        boton8.addActionListener(null);
       entrada.setText(entrada.getText() + "8");
       tipoDatos();
        
    }//GEN-LAST:event_boton8ActionPerformed

    private void boton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_boton9ActionPerformed
        // TODO add your handling code here:
        boton9.addActionListener(null);
        entrada.setText(entrada.getText() + "9");
        tipoDatos();
        
    }//GEN-LAST:event_boton9ActionPerformed

    private void boton0ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_boton0ActionPerformed
        // TODO add your handling code here:
        boton0.addActionListener(null);
        entrada.setText(entrada.getText() + "0");
        tipoDatos();
    }//GEN-LAST:event_boton0ActionPerformed

    private void botonQActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonQActionPerformed
        // TODO add your handling code here:
        botonQ.addActionListener(null);
        entrada.setText(entrada.getText() + "Q");
        tipoDatos();
        // txtLetras.setText(texto.getText());
    }//GEN-LAST:event_botonQActionPerformed

    private void botonWActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonWActionPerformed
        // TODO add your handling code here:
        botonW.addActionListener(null);
        entrada.setText(entrada.getText() + "W");
        tipoDatos();
        //txtLetras.setText(texto.getText());
    }//GEN-LAST:event_botonWActionPerformed

    private void botonEActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonEActionPerformed
        // TODO add your handling code here:
        botonE.addActionListener(null);
        entrada.setText(entrada.getText() + "E");
        tipoDatos();
        //txtLetras.setText(texto.getText());
    }//GEN-LAST:event_botonEActionPerformed

    private void botonRActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonRActionPerformed
        // TODO add your handling code here:
        botonR.addActionListener(null);
        entrada.setText(entrada.getText() + "R");
        tipoDatos();
    }//GEN-LAST:event_botonRActionPerformed

    private void botonTActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonTActionPerformed
        // TODO add your handling code here:
        botonT.addActionListener(null);
        entrada.setText(entrada.getText() + "T");
        tipoDatos();
    }//GEN-LAST:event_botonTActionPerformed

    private void botonYActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonYActionPerformed
        // TODO add your handling code here:
        botonY.addActionListener(null);
        entrada.setText(entrada.getText() + "Y");
        tipoDatos();
    }//GEN-LAST:event_botonYActionPerformed

    private void botonUActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonUActionPerformed
        // TODO add your handling code here:
        botonU.addActionListener(null);
        entrada.setText(entrada.getText() + "U");
    }//GEN-LAST:event_botonUActionPerformed

    private void botonIActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonIActionPerformed
        // TODO add your handling code here:
        botonI.addActionListener(null);
       entrada.setText(entrada.getText() + "I");
       tipoDatos();
    }//GEN-LAST:event_botonIActionPerformed

    private void botonOOActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonOOActionPerformed
        // TODO add your handling code here:
        botonOO.addActionListener(null);
        entrada.setText(entrada.getText() + "O");
        tipoDatos();
    }//GEN-LAST:event_botonOOActionPerformed

    private void botonPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonPActionPerformed
        // TODO add your handling code here:
        botonP.addActionListener(null);
        entrada.setText(entrada.getText() + "P");
        tipoDatos();
    }//GEN-LAST:event_botonPActionPerformed

    private void botonbORRARActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonbORRARActionPerformed
        // TODO add your handling code here:
        botonbORRAR.addActionListener(null);

       if(entrada.getText().length()!=0){
            entrada.setText(entrada.getText().substring(0, entrada.getText().length()-1));
       }
    }//GEN-LAST:event_botonbORRARActionPerformed

    private void botonINTROActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonINTROActionPerformed
        // TODO add your handling code here:
        botonINTRO.addActionListener(null);
        //entrada.setText(entrada.getText() + "\n");
        tipoDatos();
    }//GEN-LAST:event_botonINTROActionPerformed

    private void botonENIEActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonENIEActionPerformed
        // TODO add your handling code here:
        botonENIE.addActionListener(null);
        entrada.setText(entrada.getText() + "Ñ");
        tipoDatos();
    }//GEN-LAST:event_botonENIEActionPerformed

    private void botonLActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonLActionPerformed
        // TODO add your handling code here:
        botonL.addActionListener(null);
        entrada.setText(entrada.getText() + "L");
        tipoDatos();
    }//GEN-LAST:event_botonLActionPerformed

    private void botonKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonKActionPerformed
        // TODO add your handling code here:
        botonK.addActionListener(null);
        entrada.setText(entrada.getText() + "K");
        tipoDatos();
    }//GEN-LAST:event_botonKActionPerformed

    private void botonJActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonJActionPerformed
        // TODO add your handling code here:
        botonJ.addActionListener(null);
       entrada.setText(entrada.getText() + "J");
       tipoDatos();
    }//GEN-LAST:event_botonJActionPerformed

    private void botonHActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonHActionPerformed
        // TODO add your handling code here:
        botonH.addActionListener(null);
        entrada.setText(entrada.getText() + "H");
        tipoDatos();
    }//GEN-LAST:event_botonHActionPerformed

    private void botonGActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonGActionPerformed
        // TODO add your handling code here:
        botonG.addActionListener(null);
        entrada.setText(entrada.getText() + "G");
        tipoDatos();
    }//GEN-LAST:event_botonGActionPerformed

    private void botonFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonFActionPerformed
        // TODO add your handling code here:
        botonF.addActionListener(null);
       entrada.setText(entrada.getText() + "F");
       tipoDatos();
    }//GEN-LAST:event_botonFActionPerformed

    private void botonDActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonDActionPerformed
        // TODO add your handling code here:
        botonD.addActionListener(null);
        entrada.setText(entrada.getText() + "D");
        tipoDatos();
    }//GEN-LAST:event_botonDActionPerformed

    private void botonSActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonSActionPerformed
        // TODO add your handling code here:
        botonS.addActionListener(null);
        entrada.setText(entrada.getText() + "S");
        tipoDatos();
    }//GEN-LAST:event_botonSActionPerformed

    private void botonAActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonAActionPerformed
        // TODO add your handling code here:
        botonA.addActionListener(null);
        entrada.setText(entrada.getText() + "A");
        tipoDatos();
    }//GEN-LAST:event_botonAActionPerformed

    private void botonZActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonZActionPerformed
        // TODO add your handling code here:
        botonZ.addActionListener(null);
        entrada.setText(entrada.getText() + "Z");
        tipoDatos();
    }//GEN-LAST:event_botonZActionPerformed

    private void botonXActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonXActionPerformed
        // TODO add your handling code here:
        botonX.addActionListener(null);
        entrada.setText(entrada.getText() + "X");
        tipoDatos();
    }//GEN-LAST:event_botonXActionPerformed

    private void botonCActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonCActionPerformed
        // TODO add your handling code here:
        botonC.addActionListener(null);
        entrada.setText(entrada.getText() + "C");
        tipoDatos();
    }//GEN-LAST:event_botonCActionPerformed

    private void botonVActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonVActionPerformed
        // TODO add your handling code here:
        botonV.addActionListener(null);
      entrada.setText(entrada.getText() + "V");
      tipoDatos();
    }//GEN-LAST:event_botonVActionPerformed

    private void botonBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonBActionPerformed
        // TODO add your handling code here:
        botonB.addActionListener(null);
      entrada.setText(entrada.getText() + "B");
      tipoDatos();
    }//GEN-LAST:event_botonBActionPerformed

    private void botonNActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonNActionPerformed
        // TODO add your handling code here:
        botonN.addActionListener(null);
        entrada.setText(entrada.getText() + "N");
        tipoDatos();
    }//GEN-LAST:event_botonNActionPerformed

    private void botonMActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonMActionPerformed
        // TODO add your handling code here:
        botonM.addActionListener(null);
        entrada.setText(entrada.getText() + "M");
        tipoDatos();
        
//        
//        if(cadena.equalsIgnoreCase("PedidosH")){
//             cargarTablaHerramientas();
//             
//         }
    }//GEN-LAST:event_botonMActionPerformed

    private void botoncOMILLASActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botoncOMILLASActionPerformed
        // TODO add your handling code here:
        botoncOMILLAS.addActionListener(null);
        entrada.setText(entrada.getText() + "`");
        tipoDatos();
    }//GEN-LAST:event_botoncOMILLASActionPerformed

    private void botondOLARActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botondOLARActionPerformed
        // TODO add your handling code here:
        botondOLAR.addActionListener(null);
        entrada.setText(entrada.getText() + "$");
        tipoDatos();
    }//GEN-LAST:event_botondOLARActionPerformed

    private void botonNUMERALActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonNUMERALActionPerformed
        // TODO add your handling code here:
        botonNUMERAL.addActionListener(null);
        entrada.setText(entrada.getText() + "#");
        tipoDatos();
    }//GEN-LAST:event_botonNUMERALActionPerformed

    private void botonEspacioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonEspacioActionPerformed
        // TODO add your handling code here:
        botonNUMERAL.addActionListener(null);
        entrada.setText(entrada.getText() + " ");
        tipoDatos();
    }//GEN-LAST:event_botonEspacioActionPerformed

    private void btnSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalirActionPerformed
        // TODO add your handling code here:
        dispose();
    }//GEN-LAST:event_btnSalirActionPerformed

    
    List<Marca> marcas;
     public void cargarTablaHerramientas(){
         HerramientaDAO herramientaDAO= new HerramientaDAO(null);
        List<Herramienta> herramientas=herramientaDAO.buscarPorNombre(entrada.getText());
        marcas= new ArrayList<Marca>();
        for (int i = 0; i <herramientas.size(); i++) {
            marcas.addAll(herramientas.get(i).getMarcas());

        }
//        
        DefaultTableModel TableModel = new DefaultTableModel(){
            @Override
            public boolean isCellEditable(int rowIndex, int columnIndex) {
                if(columnIndex==5 || columnIndex==4){
                return true;
                }else{
                return false;
                }

             }

            @Override
            public Class getColumnClass(int columna){
            if(columna==4){
            return Integer.class;
            }if(columna==5){
                return Boolean.class;
            }
            return Class.class;
    }

        };
        String []  columnaNombre={"Codigo","Marca","Total", "Disponibilidad", "Cantidad a Pedir", "Selección"};
        TableModel.setColumnIdentifiers(columnaNombre);
        Object[] fila=new Object[TableModel.getColumnCount()];
        for (int i = 0; i < marcas.size(); i++) {
           fila[0]=marcas.get(i).getHerramienta().getCodigo();
           fila[1]=marcas.get(i).getNombre();
           fila[2]=marcas.get(i).getCantidad();
           fila[3]=marcas.get(i).getDisponible();
           fila[4]="";
//         fila[5]=false;
         TableModel.addRow(fila);
        }
      tablaDatos.setModel(TableModel);
      //tablaHerramientas.setRowSelectionAllowed(false);
     
     }

     
 
     
     
     List<Marka> marcasM;
    public void cargarTablaMateriales(){
        
        
        MaterialDAO materialDAO = new MaterialDAO(null);
       List <Materiales> materials= materialDAO.buscarPorNombre(entrada.getText());
      
        marcasM= new ArrayList<Marka>();
        for (int i = 0; i <materials.size(); i++) {
            //agregar a la lista de marcas el material que pertenece a esa marca
            marcasM.addAll(materials.get(i).getMarkas());
         
        }

        DefaultTableModel TableModel = new DefaultTableModel(){
            @Override
            public boolean isCellEditable(int rowIndex, int columnIndex) {
                if(columnIndex==5 || columnIndex==6){
                return true;
                }else{
                return false;
                }

             }

            @Override
            public Class getColumnClass(int columna){
            if(columna==5){
            return Integer.class;
            }if(columna==6){
                return Boolean.class;
            }
            return Class.class;
    }
        };
        
        
        
        String []  columnaNombre={"Num OT","Código","Marca","Total", "Disponibilidad", "Cantidad a Pedir", "Selección"};
        TableModel.setColumnIdentifiers(columnaNombre);
        Object[] fila=new Object[TableModel.getColumnCount()];
        for (int i = 0; i < marcasM.size(); i++) {
           fila[0]="";//pedidosMs.get(i).getOt();
           fila[1]=marcasM.get(i).getMaterial().getCodigo();
           fila[2]=marcasM.get(i).getNombreM();
           fila[3]= marcasM.get(i).getCantidadM();
           fila[4]= marcasM.get(i).getDisponibleM();
           fila[5]= "";
     
         TableModel.addRow(fila);
        }
      tablaDatos.setModel(TableModel);

        
          
}
    
     List<Pedido> pedidos;

    public void cargarPedidosH() {
        PedidoDAO pedidoDAO = new PedidoDAO(null);
        pedidos = pedidoDAO.buscartodos();

        DefaultTableModel TableModel = new DefaultTableModel() {
            @Override
            public boolean isCellEditable(int rowIndex, int columnIndex) {
                if (columnIndex == 4 || columnIndex == 3) {
                    return true;
                } else {
                    return false;
                }

            }

            @Override
            public Class getColumnClass(int columna) {
                if (columna == 3) {
                    return Integer.class;
                }
                if (columna == 4) {
                    return Boolean.class;
                }
                return Class.class;
            }
        };
        String[] columnaNombre = {"Codigo", "Herramienta", "Cant Entregada", "Cant a Devolver", "Selección"};
        TableModel.setColumnIdentifiers(columnaNombre);
        Object[] fila = new Object[TableModel.getColumnCount()];
        for (int i = 0; i < pedidos.size(); i++) {

            fila[0] = pedidos.get(i).getMarca().getHerramienta().getCodigo();
            fila[1] = pedidos.get(i).getMarca().getHerramienta().getNombre();
            fila[2] = pedidos.get(i).getCantidad();
            fila[3] = "";

            TableModel.addRow(fila);
        }
        tablaDatos.setModel(TableModel);
    
}
    
        List<PedidoMaterial> pedidoMs;
    public void cargarPedidosM(){
        PedidoMaterialDAO pmaterialDAO= new PedidoMaterialDAO(null);
       pedidoMs = pmaterialDAO.buscartodos();

        DefaultTableModel TableModel = new DefaultTableModel(){
            @Override
            public boolean isCellEditable(int rowIndex, int columnIndex) {
                if(columnIndex==4 || columnIndex==5){
                return true;
                }else{
                return false;
                }

             }

            @Override
            public Class getColumnClass(int columna){
            if(columna==4){
            return Integer.class;
            }if(columna==5){
                return Boolean.class;
            }
            return Class.class;
    }

        };
        String []  columnaNombre={"Num OT", "Codigo","Material","Cant Entregada", "Cant Devolver", "Selección"};
        TableModel.setColumnIdentifiers(columnaNombre);
        Object[] fila=new Object[TableModel.getColumnCount()];
        for (int i = 0; i < pedidoMs.size(); i++) {
            fila[0] = pedidoMs.get(i).getOtm();
            fila[1] = pedidoMs.get(i).getMarka().getMaterial().getCodigo();
            fila[2] = pedidoMs.get(i).getMarka().getMaterial().getNombre();
            fila[3] = pedidoMs.get(i).getCantidad();
            fila[4] = "";

         TableModel.addRow(fila);
        }
      tablaDatos.setModel(TableModel);

        
    }
    
      public  void tipoDatos(){
          if (cadena.equalsIgnoreCase("PedidosH")){
              cargarTablaHerramientas();
          }else{
              if(cadena.equalsIgnoreCase("PedidosM")){
                  cargarTablaMateriales();
              }else{
                  if (cadena.equalsIgnoreCase("DevH")){
                   cargarPedidosH();
                  }else{
                      cargarPedidosM();
                  }
                  
              }
                  
          }
      }
    
         
         
//         if (cadena.equalsIgnoreCase("PedidosM")){
//                 cargarTablaMateriales();
//                 
//             }
//         if(cadena.equalsIgnoreCase("DevH")){
//                     cargarPedidosH();
//                 }
//         
//         if(cadena.equalsIgnoreCase("DevM")){
//                     cargarPedidosM();}
//        
              
        
   
    /**
     * @param args the command line arguments
     */
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton boton0;
    private javax.swing.JButton boton1;
    private javax.swing.JButton boton2;
    private javax.swing.JButton boton3;
    private javax.swing.JButton boton4;
    private javax.swing.JButton boton5;
    private javax.swing.JButton boton6;
    private javax.swing.JButton boton7;
    private javax.swing.JButton boton8;
    private javax.swing.JButton boton9;
    private javax.swing.JButton botonA;
    private javax.swing.JButton botonB;
    private javax.swing.JButton botonC;
    private javax.swing.JButton botonD;
    private javax.swing.JButton botonE;
    private javax.swing.JButton botonENIE;
    private javax.swing.JButton botonEspacio;
    private javax.swing.JButton botonF;
    private javax.swing.JButton botonG;
    private javax.swing.JButton botonH;
    private javax.swing.JButton botonI;
    private javax.swing.JButton botonINTRO;
    private javax.swing.JButton botonJ;
    private javax.swing.JButton botonK;
    private javax.swing.JButton botonL;
    private javax.swing.JButton botonM;
    private javax.swing.JButton botonN;
    private javax.swing.JButton botonNUMERAL;
    private javax.swing.JButton botonOO;
    private javax.swing.JButton botonP;
    private javax.swing.JButton botonQ;
    private javax.swing.JButton botonR;
    private javax.swing.JButton botonS;
    private javax.swing.JButton botonT;
    private javax.swing.JButton botonU;
    private javax.swing.JButton botonV;
    private javax.swing.JButton botonW;
    private javax.swing.JButton botonX;
    private javax.swing.JButton botonY;
    private javax.swing.JButton botonZ;
    private javax.swing.JButton botonbORRAR;
    private javax.swing.JButton botoncOMILLAS;
    private javax.swing.JButton botondOLAR;
    private javax.swing.JButton btnSalir;
    private javax.swing.JPanel jPanel5;
    // End of variables declaration//GEN-END:variables
}
